@extends('layouts.admin')
@push('morecss')
@endpush

@push('morescript')
    <script type="application/javascript">
        let page_params = {
            @can('admin.wxqrcode.index')
            url_list: '{{ route('admin.wxqrcode.index') }}',
            @endcan
            @can('admin.wxqrcode.create')
            url_add: '{{ route('admin.wxqrcode.create') }}',
            @endcan
            @can('admin.wxqrcode.update')
            url_edit: '{{ route('admin.wxqrcode.update') }}',
            @endcan
            @can('admin.wxqrcode.destroy')
            url_del: '{{ route('admin.wxqrcode.destroy') }}',
            @endcan
        }
    </script>
    <!-- require page js -->
    <script src="{{ mix('js/admin/wxqrcode_index.js') }}"></script>
@endpush
@section('content')
    <div class="wrapper wrapper-content animated fadeInRight ecommerce">
        <div class="ibox-content m-b-sm border-bottom">
            <div class="row">
                <div class="col-sm-4">
                    <div class="form-group">
                        <label class="control-label" for="product_name">关键字</label>
                        <input type="text" id="keyword" name="keyword" value="" placeholder="请输入搜索关键字"
                               class="form-control">
                    </div>
                </div>
                <div class="col-sm-2">
                    <div class="form-group">
                        <label class="control-label" for="product_name">分组</label>
                        <select id="group_id" name="group_id" class="form-control">
                            <option value="">请选择</option>
                            @foreach($groupList as $k => $v)
                                <option value="{{ $v['group_id'] }}">{{ $v['group_name'] }}</option>
                            @endforeach
                        </select>
                    </div>
                </div>
                <div class="col-sm-2">
                    <div class="form-group">
                        <label class="control-label" for="product_name">&nbsp;&nbsp;</label>
                        <div>
                            <button class="btn btn-primary" type="button" id="btn-search"><i class="fa fa-search"></i>
                                搜索
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div id="toolbar" class="col-sm-2">
            @can('admin.wxqrcode.create')
                <button class="btn btn-primary" id="btn-add"><i class="fa fa-plus"></i> 添加</button>
            @endcan
        </div>
        <div class="row">
            <div class="col-lg-12">
                <div class="ibox">
                    <div class="ibox-content">
                        <table id="table" data-classes="table table-no-bordered">
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div id="box-form" style="display: none;">
        <div class="col-lg-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form method="POST" class="form-horizontal">
                        <input type="hidden" name="id" id="id" value="">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">分组</label>
                            <div class="col-sm-4">
                                <select id="group_id" name="group_id" class="form-control">
                                    <option value="">请选择</option>
                                    @foreach($groupList as $k => $v)
                                        <option value="{{ $v['group_id'] }}">{{ $v['group_name'] }}</option>
                                    @endforeach
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">名称</label>
                            <div class="col-sm-10">
                                <input type="text" name="name" id="name" value="" class="form-control">
                                <span class="help-block m-b-none">定义二维码名称，一般与使用改二维码的业务名称相同</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">描述</label>
                            <div class="col-sm-10">
                                <textarea name="description" id="description" class="form-control"></textarea>
                                <span class="help-block m-b-none">
                                </span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">业务主键ID</label>
                            <div class="col-sm-10">
                                <input type="text" name="relation_id" id="relation_id" value="" class="form-control">
                                <span class="help-block m-b-none">此处输入与二维码关联的其他业务主键ID</span>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-4">
                                <button class="btn btn-primary" type="button" id="btn-sub">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <div id="box-qrcode" style="display: none;">
        <div class="ibox-content">
            <img src="" class="img-responsive">
        </div>
    </div>
@endsection